package com.yjd.msg.comm.enums;

/**
 * Created by yjd-wap on 2018/1/22.
 */
public enum MsgStatusEnum {
    PENDING(0,"待发送"),
    SUCCESS(1,"发送成功"),
    CONSUME_SUCCESS(2,"消费成功"),
    CONSUME_FAIL(3,"消费失败");

    private Integer code;
    private String desc;

    private MsgStatusEnum(Integer code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static String getMsgStatusDesc(Integer code)throws Exception{
        String desc = "";
        for(MsgStatusEnum msgStatusEnum : MsgStatusEnum.values()){
            if(msgStatusEnum.getCode().intValue()==code.intValue()){
                desc = msgStatusEnum.getDesc();
                break;
            }
        }
        return desc;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }
}
